/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.ec.campaign.service.CampaignService
   Module Description   :

   Date Created      : 2009/11/18
   Original Author   : eric.chen
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.ec.campaign.service;

import java.util.List;
import java.util.Map;

import com.yaodian100.core.common.exception.CoreException;
import com.yaodian100.core.common.service.DomainService;
import com.yaodian100.ec.campaign.entity.Campaign;

/**
 * @author eric.chen
 * 
 */
public interface CampaignService extends DomainService<Campaign> {

	/**
	 * 取得目前有效的 campaigns
	 * 
	 * @param categoryPath
	 * @param productId
	 * @param options 'cookie': 請傳 UserData.applySource, default 為 yaodian100 'domain': 請傳 hostname, default 為
	 *          ServerValue.frontHostname().substring(7)
	 * @return
	 * @throws CoreException
	 */
	public List<Campaign> getValidCampaign(String categoryPath, String productId, Map options) throws CoreException;

	/**
	 * 取得以 campaigns 為基準的有效的 campaign objects
	 * 
	 * @param categoryPath
	 * @param campaigns campaign uuid
	 * @return
	 * @throws CoreException
	 */
	public List<Campaign> getValidCampaign(String categoryPath, String productId, Map options, List<String> campaigns)
			throws CoreException;

	/**
	 * 寄发活动赠品缺货通知信
	 * 
	 * @return
	 * @throws CoreException
	 */
	public boolean sendCampaignStockEmail(String domainName) throws CoreException;

	/**
	 * 
	 * @param domainName
	 * @return
	 * @throws CoreException
	 */
	public boolean chkScmPresentAndSendCampaignEmail(String domainName) throws CoreException;

	/**
	 * 取得有效的M01積分發送活動
	 * 
	 * @param options
	 * @return
	 * @throws CoreException
	 */
	public Campaign getActiveBonusCampaignByM01(Map options) throws CoreException;

	/**
	 * 取得有效的M02積分折抵活動
	 * 
	 * @param options
	 * @return
	 * @throws CoreException
	 */
	public Campaign getActiveBonusCampaignByM02(Map options) throws CoreException;

	/**
	 * 取得有效的M03會員登入次數積分發送活動
	 * 
	 * @param options
	 * @return
	 * @throws CoreException
	 */
	public Campaign getActiveBonusCampaignByM03(Map options) throws CoreException;

	/**
	 * 取得商品评价送积分活动
	 * 
	 * @param options
	 * @return
	 * @throws CoreException
	 */
	public Campaign getActiveBonusCampaignByM04(Map options) throws CoreException;

}
